﻿#ifndef RULERWIDGET_H
#define RULERWIDGET_H

#include <QWidget>
#include <QPainter>
#include <cglobals.h>

//#pragma execution_character_set("utf-8")

class RulerWidget : public QWidget
{
    Q_OBJECT
public:
    explicit RulerWidget(QWidget *parent = nullptr);
    ~RulerWidget();
    void setScale(int scale);
    void setCommonParameters(pCOMMONS pCommons);


protected:
    void paintEvent(QPaintEvent *);

private:
    int scale;
    pCOMMONS pCommonParameters;

public:
    enum SCALE
    {
        ONE = 1,                                        // 1周期/小格
        TWO = 2,                                        // 2周期/小格
        FIVE = 5,                                       // 5个周期/小格
        TEN = 10,                                       // 10个周期/小格
        TWENTY = 20                                     // 20个周期/小格
    };

};

#endif // RULERWIDGET_H
